<#include "/ftl/lib/operations.ftl"/>
<#if type?has_content>
<div class="easyui-layout" fit="true">  
	<div region="north" style="padding:5px;border:1px solid #ddd; background-color: #f4f4f4" id="global_${action_id}" >
	</div>  
	<div region="center" border="false">
		<div class="easyui-panel"  data-options="href:'${request.contextPath}${namespace?default('')}/mp/sso/member-list.htm?action_id=${action_id}&type=${type?default('')}',fit:true">
		</div>
	</div>  
</div>
<#else>
<div class="easyui-layout" fit="true">  
	<div data-options="region:'center',split:true" >
		<div class="easyui-layout" fit="true" border="false">
			<div region="north"  style="padding:5px;border:1px solid #ddd; background-color: #f4f4f4" id="global_${action_id}"  >
			</div> 
			<div data-options="region:'center',split:true,border:false" style="height: 100px;" >
				<div class="easyui-panel"  data-options="href:'${request.contextPath}${namespace?default('')}/mp/sso/member-list.htm?action_id=${action_id}',fit:true">
				</div>
			</div>
		</div>
	</div>
</div>
</#if>
<script type="text/javascript">
function type_${action_id}(id){
	$('#datagrid_${action_id}').datagrid('options').queryParams={'_searcher_eq_type#id':id};
	$('#datagrid_${action_id}').datagrid('reload');
}

/**
 * 货币变更记录
 */
function log_${action_id}(data){
	$('<div/>').dialog({
		href:'${request.contextPath}${namespace?default('')}/mp/sso/currencylog-list.htm?id='+data.id,
		width:500,   
		height:500,   
		title: '${action.getText('log.btn.title')}',
		modal:true,
		collapsible:false,
		minimizable:false,
		resizable:true,
		onClose : function() {
			$(this).dialog('destroy');
		}
	});
}

/**
 * 变更货币
 cur:货币名称
 */
function alter_currency_${action_id}(data,cur){
	$('<div>').dialog({
		href : '${request.contextPath}${namespace?default('')}/mp/sso/member-alter.htm?action_id=${action_id}&key='+cur+'&id='+data.id,
		width:500,   
		height:500,   
		modal : true,
		title : '${action.getText('currency.change.btn')}',
		buttons : [ {
			text : '${action.getProperty('net.esj.background.message','bg.datagrid.edit')}',
			iconCls : 'icon-edit',
			handler : function() {
				var d = $(this).closest('.window-body');
				$('#sso_currency_alter_form_${action_id}').form('submit', {
					url : '${request.contextPath}${namespace?default('')}/mp/sso/member-doAlter.json',
					onSubmit: function(){
						return $(this).form('validate');
    				},
					success : function(json) {
						eval("json="+json);
						$.messager.alert(json.title,json.msg,json.level);
						if(json.level!='error'){
							d.dialog('destroy');
							$("#datagrid_${action_id}").datagrid('reload');
						}
					}
				});
			}
		} ],
		onClose : function() {
			$(this).dialog('destroy');
		}
	});
}
</script>
<@operations contextUri='mp/sso/member' />